package cn.iocoder.yudao.module.security.dal.mysql.whitelistoperate;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.security.dal.dataobject.whitelistoperate.WhitelistOperateDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.security.controller.admin.whitelistoperate.vo.*;

/**
 * 白名单操作 Mapper
 *
 * @author cai
 */
@Mapper
public interface WhitelistOperateMapper extends BaseMapperX<WhitelistOperateDO> {

    default PageResult<WhitelistOperateDO> selectPage(WhitelistOperatePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WhitelistOperateDO>()
                .betweenIfPresent(WhitelistOperateDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(WhitelistOperateDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(WhitelistOperateDO::getStatus, reqVO.getStatus())
                .eqIfPresent(WhitelistOperateDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(WhitelistOperateDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WhitelistOperateDO::getId));
    }

}